package cn.service.orderService.OrderServiceImpl;

import cn.service.orderService.ReturnSerService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import entity.Result;
import entity.orderEntity.ReturnApplyCondition;
import entity.orderEntity.ReturnShow;
import mapper.orderMapper.ReturnServiceMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/28 19:31
 */
@Service
public class ReturnSerServiceImpl implements ReturnSerService {
    @Resource
    ReturnServiceMapper mapper;

    @Override
    public Result getReturnInfo(ReturnApplyCondition returnApplyCondition) {
        PageHelper.startPage(returnApplyCondition.getCurrentPage(),returnApplyCondition.getPageSize());
        Page<ReturnShow> page= (Page<ReturnShow>) mapper.getReturnInfo(returnApplyCondition);
        System.out.println(page.getTotal());
        return Result.success((int)page.getTotal(),page.getResult());
    }

    @Override
    public Result getreturnDetailInfo(Integer return_id) {
        return Result.success(200,mapper.selectByPrimaryKey(return_id));
    }
}
